Using web player templates
Manual     Reference     Scripting   
Unity Manual > Web Player Deployment > Using web player templates

Using web player templates

Desktop

To ease rapid deployment as well as testing of your web player in its intended setup, Unity comes with a selection of different templates and support for custom templates.

A template is a folder containing an index file (this could just as easily be a php file as an html file) with some special tags in it and an optional thumbnail image. The name of the folder names the template and it can contain any resources that might be used in the presentation of it - such as subfolders, images, JavaScripts, server-side scripts and so forth.

Built in templates, accessible for all projects, are located in the WebPlayerTemplates folder in the Resources folder of the Unity editor application and custom templates are picked up from a folder named WebPlayerTemplates in your projects Assets folder.

Templates are selectable in the player settings. You will find all available templates listed there with each their thumbnail (or the default one if no thumbnail file was provided) and name. Some templates have additional properties, which can be tweaked in the text fields immediately below the template selector.

Template index file tags translation table:

TagMeaning
%UNITY_WEB_NAME%Name of the webplayer.
%UNITY_WIDTH%Width of the webplayer.
%UNITY_HEIGHT%Height of the webplayer.
%UNITY_WEB_PATH%Path to the unity3d file.
%UNITY_UNITYOBJECT_LOCAL%Path to the local UnityObject.js file.
%UNITY_UNITYOBJECT_URL%URL UnityObject.js hosted on unity3d.com.
%UNITY_BETA_WARNING%Location for the Unity beta build warning message.
%UNITY_CUSTOM_SOME_TAG%Custom template tag "Some tag" - can be set from player settings.

Page last updated: 2010-07-12